package org.solr;

import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.HttpSolrServer;
import org.apache.solr.client.solrj.response.QueryResponse;

public class SelectIndex {
	private static final String BaseURL = "http://localhost:8983/solr/collection1";

	public static void main(String[] args) throws SolrServerException {
		HttpSolrServer httpSolrServer = new HttpSolrServer(BaseURL);		
		 SolrQuery query = new SolrQuery();
		 query.set("q", "*:*");
		 QueryResponse query2 = httpSolrServer.query(query);
		 query2.getResults().getNumFound();
		 System.out.println(query2.getQTime());
		
	}
}
